import request from '@/utils/request'

const api = {
  list: '/system/app/getAppList', // app列表
  update: '/system/app/setApp', // 修改app版本
  updateState: '/system/app/setAppState', // 修改上线下线
  add: '/system/app/addApp', // 上传app版本
  del: '/system/app/delAppState', // 删除
  verify: '/system/app/addAppVerify', // 验证是否重复上传
}

export function getAppList (params) {
  return request({
    url: api.list,
    method: 'POST',
    data: params
  })
}

export function setApp (params) {
  return request({
    url: api.update,
    method: 'POST',
    data: params
  })
}

export function setAppState (params) {
  return request({
    url: api.updateState,
    method: 'POST',
    data: params
  })
}

export function addApp (params) {
  return request({
    url: api.add,
    method: 'POST',
    data: params
  })
}

export function delAppState (params) {
  return request({
    url: api.del,
    method: 'POST',
    data: params
  })
}

export function verifyAppUpload(params) {
  return request({
    url: api.verify,
    method: 'POST',
    data: params
  })
}